#ifndef __DRV_COMMON_DEF_H
#define __DRV_COMMON_DEF_H

#include <stdint.h>
#include <stdio.h>
#include "drv_base.h"
#ifdef __cplusplus
extern "C" {
#endif

typedef int errno_t;

typedef enum {
    STATE_OK = 0x0,
    STATE_FAIL,
} StateCode;

void Dev_Delay_init(void);
void Delay_us(uint32_t us);
void Delay_ms(uint32_t ms);

void Log_Output(const char *funcName, int lineNum, const char *fmt, ...);

#define LOG_INFO(fmt, ...) Log_Output(__func__, __LINE__, fmt, ##__VA_ARGS__)

char *U64ToString(const uint64_t num, char *numStr, size_t arrLen);
char *Float64ToString(const double num, char *numStr, size_t arrLen);

#ifdef __cplusplus
}
#endif
#endif